#ifndef __TCC_ASTAR_H__
#define __TCC_ASTAR_H__
#include "AstarFindPath.hpp"

#pragma pack(1)
struct astar_path_node
{
	int x;
	int y;
	struct astar_path_node* next;
};
#pragma pack()

typedef bool (*Astar_IsMovable)(int, int);
typedef int (*Astar_GetMoveCost)(int, int);

Astar::AstarFinder* astar_new();
void astar_delete(Astar::AstarFinder* astar);

void astar_set_hestimate(Astar::AstarFinder* astar, int hestimate);
void astar_set_diagonal_movable(Astar::AstarFinder* astar, bool movable);
void astar_set_heavy_diagonals(Astar::AstarFinder* astar, bool heavy);

bool astar_init_map(Astar::AstarFinder* astar, int width, int height, Astar_IsMovable is_moveable, Astar_GetMoveCost get_move_cast);
astar_path_node* astar_find_path(Astar::AstarFinder* astar, int start_x, int start_y, int end_x, int end_y, Astar::HeuristicFormula formula, int search_limit);

void astar_delete_path(astar_path_node* node);
#endif//__TCC_ASTAR___